<template>
<view>
	<u-navbar :is-back="false" title="商品入库详情"
	  title-size="30"
	  :background="{background:'#2B88FE' }"
	  title-color="#fff">
	  <div class="head_icon">
	    <u-icon @click="$api.handleBackTo"
	      name="arrow-left" color="#fff"
	      size="36">
	    </u-icon>
	    <u-icon @click="$api.handleHomeTo"
	      name="home" color="#fff" size="36">
	    </u-icon>
	  </div>
	</u-navbar>
	

	
  <div class="app-draw-record">
    <u-empty text="暂无数据" mode="list" v-if="!clist.length"></u-empty>
    <u-tag class="tag" :text="date" shape="circle" />

    <appProduct v-for="(v,i) in clist" :key="i" :li="v"></appProduct>
  </div>
</view>	</template>

<script>
import appProduct from '@/components/app-product'
export default {
  components: {
    appProduct
  },
  data() {
    return {
      id: 0,
      date: '',
      search: '',
      clist: []
    }
  },
  onLoad(e) {
    this.date = e.date
    this.id = e.id
  },
  onShow() {
    this.getclist()
  },
  methods: {
    getclist() {
      this.$axios('api/ProInAndOutList/DataList', 'post', { value: this.id }).then(res => {
        res.Value.forEach(v => {
          v.gname = v.fProName
          v.id = v.fProId
          v.details = [
			 { label: '单位', value: v.fUnit },
            { label: '入库数量', value: v.fCount },
            { label: '到期时间', value: v.fOverTime }
          ]
        })
        this.clist = res.Value
      })
    },
    handleUrlAdd() {
      uni.navigateTo({
        url: '/pages/stock/ProIn/AddDetail'
      })
    }
  }
}
</script>

<style>
.tag {
  margin: 20rpx;
}
</style>